#include "vertex_types.fxh"
#include "Samplers.fxh"
#include "globals.fxh"

TNORMAL_TEXTURED_VERTEX_PS RenderVS(TNORMAL_COLORED_2TEXTURED_VERTEX_VS IN)
{
	TNORMAL_TEXTURED_VERTEX_PS OUT=(TNORMAL_TEXTURED_VERTEX_PS)0;
    OUT.HPosition=mul(float4(IN.Position,1.0),g_WorldViewProjectionMatrix);
	OUT.WorldNormal = IN.Normal;
	//OUT.WorldNormal = mul(IN.Normal,(float3x3) g_WorldMatrix);
    return OUT;
}

float4 RenderPS(TNORMAL_TEXTURED_VERTEX_PS IN) : COLOR
{
//return float4(IN.WorldNormal, 1.0);
	float3 Nn = normalize(IN.WorldNormal); 
	return float4(Nn,1);
}


technique tecNormals
{
	pass p0 
	{
		CullMode = None;
		VertexShader = compile vs_3_0 RenderVS();
		PixelShader = compile ps_3_0 RenderPS();
	}
}